package com.example.jpa1.service;

import com.example.jpa1.dao.StudentDao;
import com.example.jpa1.pojo.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class StudentService {

    @Autowired
    private StudentDao studentDao;

    public List<Student> list(String name){
//        System.out.println(studentDao);
       return studentDao.getList(name);
//     return studentDao.getList();
//        return null;
    }
    public void removeById(Long id){
        studentDao.deleteById(id);
    }
}
